<template>
  <div id="app">
    <todo-header title="待办事项列表">
      <p slot="subtitle">自定义的副标题</p>
      <!-- <template v-slot:title>
        <div>自定义主标题内容</div>
      </template> -->
      <template #title>
        <div>自定义主标题内容</div>
      </template>
    </todo-header>
    <todo-input />
    <todo-list />
  </div>
</template>

<script>
import axios from 'axios'
import TodoHeader from './components/TodoHeader.vue'
import TodoInput from './components/TodoInput.vue'
import TodoList from './components/TodoList.vue'
export default {
  name: 'App',
  components: { TodoInput, TodoList, TodoHeader },
  created () {
    // fetch('https://jsonplaceholder.typicode.com/todos?userId=1')
    //   .then(response => response.json())
    //   .then(data => console.log('数据：', data))
    //   .catch(err => console.log(err))

    axios.get('https://jsonplaceholder.typicode.com/todos?userId=1')
      .then(res => console.log('axios:', res))
      .catch(err => console.log(err))
  }
}
</script>

<style>
</style>
